<template>
  <div class="topBar">
    <div class="topBarRouter">
      <div class="topBarLeft" @click="goBack">
        <slot name="left"></slot>
      </div>
      <div class="topBarTitle">
        <slot name="title"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TopBar',
  data() {
    return {
      currentIndex: 0
    };
  },
  methods: {
    goBack() {
      this.$emit('goBack');
      // this.$router.go(-1);
    }
  }
};
</script>

<style scoped>
  /* .topBar{
    height: 120px;
    border-bottom: 2px #508FCC solid;
  } */
  .topBarRouter{
    display: flex;
  }
  .topBarLeft{
    width: 126px;
    height: 48px;
    text-align: center;
    background-image: linear-gradient(to right,#82AADA,#5D96D6,#1F77CF);
    line-height: 48px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 20px 0px 20px 0px;
  }
  .topBarTitle{
    flex: 1;
    height: 48px;
    background-image: linear-gradient(to right,#87ACDA,#699CD7,#4484C7,#3481D1,#1471CD);
    line-height: 48px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    margin-left: 18px;
    text-indent: 37px;
    border-radius: 0px 0px 0px 20px;
  }
  .topBarNav{
    display: flex;
    margin-top: 30px;
  }
  .topBarNav>div{
    width: 144px;
    height: 42px;
    text-align: center;
    font-size: 18px;
    color: #666666;
    line-height: 20px;
  }
  .topBarNav>div:hover{
    cursor: pointer;
  }
  .topBarNav>.active{
    color: #508FCC;
    font-size: 20px;
    line-height: 19px;
  }
</style>
